package com.qst.rongxiaotong.service.Impl;

import com.qst.rongxiaotong.mapper.DiscussMapper;
import com.qst.rongxiaotong.pojo.Discuss;
import com.qst.rongxiaotong.service.DiscussService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DiscussServiceImpl implements DiscussService {
    @Autowired
    DiscussMapper discussMapper;

    //添加评论
    @Override
    public void add(Discuss discuss) {
        discussMapper.insertSelective(discuss);
    }

    //查找评论
    @Override
    public List<Discuss> selectByKnowledgeId(Integer knowledgeId) {
        List<Discuss> discusses = discussMapper.selectByKnowledgeId(knowledgeId);
        return discusses;
    }
}
